package com.ruoyi.combat.util.zhihu;

import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class ZhihuApiUtil {

    @Value("${zhihu.crawlIp}")
    private String crawlIp;

    public void collectData(List<String> list) {
        try {
            Map dataMap  = new HashMap();
            dataMap.put("userID",list);
            String data = JSONUtil.toJsonStr(dataMap);
            String post = HttpUtil.post(crawlIp, data);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
